﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EFExtention.Common.DataModel;
using EFExtention.Common.Utils;

namespace EFExtention.Common.ViewModel {
    partial class ReadOnlyCollectionViewModel<TEntity, TUnitOfWork> : ReadOnlyCollectionViewModelBase<TEntity, TUnitOfWork>
        where TEntity : class
        where TUnitOfWork : IUnitOfWork {
        protected TUnitOfWork UnitOfWork {
            get { return (TUnitOfWork)Repository.UnitOfWork; }
        }
        protected virtual IList<TLookUpEntity> GetLookUpEntities<TLookUpEntity>(IReadOnlyRepository<TLookUpEntity> repository) where TLookUpEntity : class {
            repository.GetEntities().Load();
            return repository.Local;
        }
    }
}
